<?php
/**
 * Created by PhpStorm.
 * User: jocky
 * Date: 29/08/2017
 * Time: 13:46
 */

?>

<div class="login-container">
    <div class="login-box animated fadeInDown" style="padding-top: 30px;">
        <div class="text-center" style="padding: 20px 0 40px;font-size: 30px;color:#777;text-shadow: 3px 3px 3px #ffffff;">
            天玺智能交易系统
        </div>

        <div class="login-body">
            <div class="login-title text-center" style="text-shadow: 3px 3px 3px #777;">账户登录</div>
            <form class="form-horizontal" id="login-form">
                <div class="form-group">
                    <div class="col-md-12">
                        <input class="form-control"
                               type="text"
                               name="clientSN"
                               maxlength="32"
                               value="<?= $clientSN; ?>"
                               data-error="请输入客户编号"
                               placeholder="客户编号">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12">
                        <input class="form-control"
                               type="password"
                               name="password"
                               maxlength="32"
                               data-error="请输入账户密码"
                               placeholder="密码">
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-xs-7">
                        <input class="form-control"
                               type="text" name="captcha"
                               data-error="请输入图片验证码"
                               placeholder="图片验证码">
                    </div>
                    <div class="col-xs-5">
                        <?php
                        echo \yii\captcha\Captcha::widget([
                            'name' => 'captchaImg2',
                            'captchaAction' => 'login/captcha',
                            'template' => '{image}',
                            'options' => [
                                'maxlength' => 4
                            ],

                            'imageOptions' => [
                                'id' => 'captchaImg2',
                                'alt' => '验证码',
                                'title' => '点击刷新',
                                'class' => 'img-response captchaImg',
                                'onclick' => 'refreshCaptcha(2)',
                            ]
                        ]);
                        ?>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12">
                        <button name="form-submit"
                                type="button"
                                class="btn btn-info btn-block btn-lg"
                                onclick="sendLogin()">
                            登 录
                        </button>
                    </div>
                </div>
                
                <div class="login-subtitle text-right">
                    <a href="/password/retrieve">忘记密码</a>
                </div>

                <div class="login-subtitle text-right" style="color: #707070;">
                    没有账户？ <a href="/reg">点击注册</a>
                </div>
                <?php
                echo \yii\helpers\Html::hiddenInput(
                    Yii::$app->request->csrfParam,
                    Yii::$app->request->getCsrfToken()
                );
                ?>
            </form>
        </div>
        <div class="login-footer" style="padding: 30px;">
            <div class="text-center" style="color: #707070;">
                <strong>&copy; 2018-<?= date('Y') ?> All Rights Reserved.</strong>
            </div>
        </div>
                        <div class="clearfix"></div>
                <div><p style="font-size: 15px;">尊敬的客户，为了更好的体验请使用谷歌浏览器或者火狐浏览器打开本系统。</p></div>
                <div style="text-align: center;"><a href="https://www.google.cn/chrome/"><strong style="font-size:12px; color: red;">谷歌浏览器</strong>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="https://download-ssl.firefox.com.cn/releases-sha2/stub/official/zh-CN/Firefox-latest.exe"><strong style="font-size: 12px; color: red;">火狐浏览器</strong></div>
    </div>
</div>
<script type="text/javascript" src="/js/login.js?v=<?= Yii::$app->params['version'] ?>"></script>
<!-- <script type = "text/javascript" >
    window.onload=function(){
        var BrowserMatch = {
        init: function() {
            this.browser = this.getBrowser().browser || "An Unknown Browser";
            this.version = this.getBrowser().version || "An Unknown Version";
            this.OS = this.getOS() || "An Unknown OS";
        },
        getOS: function() {
            if (navigator.platform.indexOf("Win") != -1) return "Windows";
            if (navigator.platform.indexOf("Mac") != -1) return "Mac";
            if (navigator.platform.indexOf("Linux") != -1) return "Linux";
            if (navigator.userAgent.indexOf("iPhone") != -1) return "iPhone/iPod";
        },
        getBrowser: function() {
            var rMsie = /(msie\s|trident\/7)([\w\.]+)/;
            var rTrident = /(trident)\/([\w.]+)/;
            var rFirefox = /(firefox)\/([\w.]+)/;
            var rOpera = /(opera).+version\/([\w.]+)/;
            var rNewOpera = /(opr)\/(.+)/;
            var rChrome = /(chrome)\/([\w.]+)/;
            var rSafari = /version\/([\w.]+).*(safari)/;
            var ua = navigator.userAgent.toLowerCase();
            var matchBS, matchBS2;
            matchBS = rMsie.exec(ua);
            if (matchBS != null) {
                matchBS2 = rTrident.exec(ua);
                if (matchBS2 != null) {
                    switch (matchBS2[2]) {
                        case "4.0":
                            return {
                                browser:
                                    "IE",
                                version: "8"
                            };
                            break;
                        case "5.0":
                            return {
                                browser:
                                    "IE",
                                version: "9"
                            };
                            break;
                        case "6.0":
                            return {
                                browser:
                                    "IE",
                                version: "10"
                            };
                            break;
                        case "7.0":
                            return {
                                browser:
                                    "IE",
                                version: "11"
                            };
                            break;
                        default:
                            return {
                                browser:
                                    "IE",
                                version: "Undefined"
                            };
                    }
                } else {
                    return {
                        browser: "IE",
                        version: matchBS[2] || "0"
                    };
                }
            }
            matchBS = rFirefox.exec(ua);
            if ((matchBS != null) && (!(window.attachEvent)) && (!(window.chrome)) && (!(window.opera))) {
                return {
                    browser: matchBS[1] || "",
                    version: matchBS[2] || "0"
                };
            }
            matchBS = rOpera.exec(ua);
            if ((matchBS != null) && (!(window.attachEvent))) {
                return {
                    browser: matchBS[1] || "",
                    version: matchBS[2] || "0"
                };
            }
            matchBS = rChrome.exec(ua);
            if ((matchBS != null) && ( !! (window.chrome)) && (!(window.attachEvent))) {
                matchBS2 = rNewOpera.exec(ua);
                if (matchBS2 == null) {
                    return {
                        browser: matchBS[1] || "",
                        version: matchBS[2] || "0"
                    };
                } else {
                    return {
                        browser: "Opera",
                        version: matchBS2[2] || "0"
                    };
                }
            }
            matchBS = rSafari.exec(ua);
            if ((matchBS != null) && (!(window.attachEvent)) && (!(window.chrome)) && (!(window.opera))) {
                return {
                    browser: matchBS[2] || "",
                    version: matchBS[1] || "0"
                };
            }
        }
    };
    BrowserMatch.init();
    // alert("当前浏览器为" + BrowserMatch.browser +"\n版本为:"+ BrowserMatch.version + "\n所处操作系统为"+BrowserMatch.OS);
    if (BrowserMatch.browser=="IE"){
        alert("当前浏览器为"+BrowserMatch.browser +"  ,请使用谷歌或者火狐浏览器");
        $(".form-control").attr("disabled","disabled");
    }
    }
</script> -->